package com.sanuo.pico.event;

import com.menu.app.event.BaseIntEvent;

public class Co2IntEvent extends BaseIntEvent {

    Integer old = null;

    public Co2IntEvent() {
        super();
    }

    @Override
    public boolean postValue(Integer value) {
        setValue(value);
        post();
        return true;
    }

    public <T extends Co2IntEvent> T saveOld() {
        old = getValue();
        return (T) this;
    }

    public void restoreOld() {
        if (old != null) {
            postValue(old);
            old = null;
        }
    }

    public Integer getOld() {
        return old;
    }
}
